package com.nuanshui.heatedloan.credit.utils;

import com.nuanshui.heatedloan.baseservice.model.UserAgent;
import com.nuanshui.heatedloan.credit.constant.ClientType;

/**
 * Created by wangxw on 2017/7/20.
 */
public class UserAgentUtil {


    public static String  getClient(UserAgent userAgent) {

        String c = userAgent.getClient();
        if (c == null)
            return ClientType.UNKNOWN;
        if (c.startsWith("iPhone")) {
            return ClientType.IOS;
        } else if (c.startsWith("android")) {
            return ClientType.ANDROID;
        }else if(c.startsWith("h5")){
            return ClientType.H5;
        }
        return null;
    }
}

